<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output method="xml" omit-xml-declaration="yes"/>

<xsl:variable name="file-container"><xsl:call-template name="substring-after-last"><xsl:with-param name="string" select="files/file[1]/fileURL"	/><xsl:with-param name="delimiter" select="'.'"	/></xsl:call-template></xsl:variable>


<!--######################################################## TV STYLE PART #####################################################-->

<xsl:template name="meow-tv-style">

<!--*****************These are system variables	the skin uses....do not	change these***************-->
<xsl:variable name="file-container"><xsl:call-template name="substring-after-last"><xsl:with-param name="string" select="files/file[1]/fileURL"	/><xsl:with-param name="delimiter" select="'.'"	/></xsl:call-template></xsl:variable>
<xsl:variable name="short-plot"><xsl:call-template name="substring-before-last"><xsl:with-param	name="string" select="plot" /><xsl:with-param name="delimiter" select="'.'" /></xsl:call-template></xsl:variable>
<xsl:variable name="plot"><xsl:value-of	select="plot"/></xsl:variable>
<xsl:variable name="typeA"><xsl:call-template name="substring-after-last"><xsl:with-param name="string"	select="files/file[1]/fileURL" /><xsl:with-param name="delimiter" select="'file:///opt/sybhttpd/localhost.drives/'" /></xsl:call-template></xsl:variable>
<xsl:variable name="typeB"><xsl:call-template name="plot"><xsl:with-param name="string"	select="$typeA"	/><xsl:with-param name="delimiter" select="'/'"	/></xsl:call-template></xsl:variable>
<xsl:variable name="fileplace"><xsl:call-template name="substring-after-last"><xsl:with-param name="string" select="files/file[1]/fileURL" /><xsl:with-param name="delimiter" select="'file:///opt/sybhttpd/localhost.drives/'"	/></xsl:call-template></xsl:variable>

<!--********************End of system variables*****************************-->

<!--###########################HORIZONTAL##################################################-->

<xsl:if test="$set-tv='hor'">
<style>
<xsl:choose>
<xsl:when test="$horizontal-tv-plot-visible = 'true'">
#popup-hor{visibility:visible;}
</xsl:when>
<xsl:otherwise>
#popup-hor{visibility:hidden;}
</xsl:otherwise>
</xsl:choose>
#navlinks {visibility:hidden;position:absolute; top:175; left:525;}
#navimage {visibility:hidden; position:absolute; top:1; left:57;}
#epoverlay {visibility:visible;position:absolute;top:305;left:4;}
<xsl:choose>
<xsl:when test="$horizontal-tv-plot-visible = 'true'">
#epplotoverlay {visibility:visible;position:absolute;top:3;left:52;}
</xsl:when>
<xsl:otherwise>
#epplotoverlay {visibility:hidden;position:absolute;top:3;left:52;}
</xsl:otherwise>
</xsl:choose>
#TvInfoOverlay {visibility:visible;position:absolute;top:523;left:0;}
<xsl:choose>
	<xsl:when test="$show-banner-hor='true'">
		#coveroverlay {visibility:hidden;position:absolute;top:15;left:9;}
	</xsl:when>
	<xsl:otherwise>
		#coveroverlay {visibility:visible;position:absolute;top:15;left:9;}
	</xsl:otherwise>
</xsl:choose>
<xsl:choose>
	<xsl:when test="$show-banner-hor='false'">
		#banneroverlay {visibility:hidden;position:absolute;top:21;left:1;}
	</xsl:when>
	<xsl:otherwise>
		#banneroverlay {visibility:visible;position:absolute;top:21;left:1;}
	</xsl:otherwise>
</xsl:choose>
</style>
</xsl:if>
<!--###########################/HORIZONTAL##################################################-->

<!--###########################Vertical##################################################-->

<xsl:if test="$set-tv='ver'">
<style>
<xsl:choose>
<xsl:when test="$vertical-tv-plot-visible = 'true'">
#popup-ver{visibility:visible;}
</xsl:when>
<xsl:otherwise>
#popup-ver{visibility:hidden;}
</xsl:otherwise>
</xsl:choose>
#navlinks {visibility:hidden;position:absolute; top:175; left:525;}
#navimage {visibility:hidden; position:absolute; top:1; left:57;}
#epoverlay {visibility:visible;position:absolute;top:1;left:670;}
<xsl:choose>
<xsl:when test="$vertical-tv-plot-visible = 'true'">
#epplotoverlay {visibility:visible;position:absolute;top:386;left:1;}
</xsl:when>
<xsl:otherwise>
#epplotoverlay {visibility:hidden;position:absolute;top:386;left:1;}
</xsl:otherwise>
</xsl:choose>
#TvInfoOverlay {visibility:hidden;position:absolute;top:523;left:0;}
<xsl:choose>
	<xsl:when test="$show-banner-ver='true'">
		#coveroverlay {visibility:hidden;position:absolute;top:15;left:9;}
	</xsl:when>
	<xsl:otherwise>
		#coveroverlay {visibility:visible;position:absolute;top:15;left:9;}
	</xsl:otherwise>
</xsl:choose>
<xsl:choose>
	<xsl:when test="$show-banner-ver='false'">
		#banneroverlay {visibility:hidden;position:absolute;top:32;left:107;}
	</xsl:when>
	<xsl:otherwise>
		#banneroverlay {visibility:visible;position:absolute;top:32;left:107;}
	</xsl:otherwise>
</xsl:choose>
</style>
</xsl:if>

<!--###########################/Vertical##################################################-->

<script	type="text/javascript" src="Categories.html">&#160;</script>
<script	type="text/javascript" src="pictures/passit.js">&#160;</script>

<script	type="text/javascript">
function togglePopup(x)
{
  var temp = document.styleSheets[1].cssRules[1].style
  var tempnew =	document.styleSheets[1].cssRules[2].style
  if ( temp.visibility == 'visible' )
   {
	temp.visibility	= 'hidden'
	tempnew.visibility = 'hidden'
	document.getElementById('navchange').setAttribute("href", "#movies4");
  }
  else
   {
	temp.visibility	= 'visible'
	tempnew.visibility = 'visible'
	document.getElementById('navchange').setAttribute("href", "#middle");
  }
  return
}
</script>


<script	type="text/javascript">
function toggleplot()
{
  var temp = document.styleSheets[1].cssRules[0].style
  var temp2 = document.styleSheets[1].cssRules[4].style
  if ( temp.visibility == 'visible' )
   {
	temp.visibility	= 'hidden'
	temp2.visibility = 'hidden'
  }
  else
   {
	temp.visibility	= 'visible'
	temp2.visibility = 'visible'
  }
  return false
}
</script>


<script>
var epfile = [<xsl:for-each select="files/file">"<xsl:value-of select="fileURL"/>"<xsl:if test="position() != last()">,</xsl:if></xsl:for-each>];
</script>

<script>
var epimage = [<xsl:for-each select="files/file">"<xsl:value-of disable-output-escaping="yes" select="fileImageFile"/>"<xsl:if test="position() != last()">,</xsl:if></xsl:for-each>];
</script>
<script>
var epplot =  [<xsl:for-each select="files/file">"<xsl:value-of disable-output-escaping="yes" select="concat(substring(translate(filePlot, '&quot;', &quot;'&quot;), 1, 550),	'...')"/>"<xsl:if test="position() != last()">,</xsl:if></xsl:for-each>];
</script>
<script>
var eptitle = [<xsl:for-each select="files/file">"<xsl:value-of disable-output-escaping="yes" select="translate(@title, '&quot;', &quot;'&quot;)"/>"<xsl:if test="position() != last()">,</xsl:if></xsl:for-each>]

var yontv = 0
var epstart=<xsl:value-of select="files/file[1]/@firstPart"/>
var epnow=<xsl:value-of	select="files/file[1]/@firstPart"/>

function episodechange(y)
{
var glen = epimage.length
var ending = glen - 1
var last = ending - 1


if (yontv+y<xsl:value-of select="'&lt;'" disable-output-escaping="yes"/>0)
{
yontv=ending
epnow=ending+1
}
else if	(yontv+y<xsl:value-of select="'&gt;'" disable-output-escaping="yes"/>ending)
{
yontv=0
epnow=epstart
}
else
{
yontv=yontv+y
epnow=epnow+y
}

<!--###########################HORIZONTAL##################################################-->

<xsl:if test="$set-tv='hor'">
var m3 =epimage[(yontv+3+ epimage.length) % epimage.length]
var m4=	epimage[(yontv-1+ epimage.length) % epimage.length]
var m5 =epimage[(yontv + epimage.length) % epimage.length]
var m52	=epplot[(yontv + epimage.length) % epimage.length]
var m53	=epfile[(yontv + epimage.length) % epimage.length]
var m54	=eptitle[(yontv	+ epimage.length) % epimage.length]

var m6 =epimage[(yontv+1+ epimage.length) % epimage.length]
var m7=	epimage[(yontv+2+ epimage.length) % epimage.length]
var epnum=epnow
	
document.getElementById('imageone').setAttribute("src", m3);
document.getElementById('imagetwo').setAttribute("src", m4);

document.getElementById('imagethree').setAttribute("src", m6);
document.getElementById('imagefour').setAttribute("src", m7);

document.getElementById('middleimage').setAttribute("src", m5);
document.getElementById('middlelink').setAttribute("href", m53);
document.getElementById('epplot').firstChild.nodeValue=m52;
document.getElementById('eptitle4').firstChild.nodeValue=m54;
document.getElementById('epnumber').firstChild.nodeValue="&#160;&#160;Episode "+epnum+".&#160;";
document.getElementById('playlists').setAttribute("href", "<xsl:value-of disable-output-escaping="yes" select="baseFilename"/>.playlist"+epnum+".jsp");
</xsl:if>

<!--###########################/HORIZONTAL##################################################-->

<!--###########################VERTICAL##################################################-->

<xsl:if test="$set-tv='ver'">
var m3 =epimage[(yontv+4+ epimage.length) % epimage.length]
var m4=	epimage[(yontv+3+ epimage.length) % epimage.length]
var m5 =epimage[(yontv + epimage.length) % epimage.length]
var m52	=epplot[(yontv + epimage.length) % epimage.length]
var m53	=epfile[(yontv + epimage.length) % epimage.length]
var m54	=eptitle[(yontv	+ epimage.length) % epimage.length]

var m6 =epimage[(yontv+2+ epimage.length) % epimage.length]
var m7=	epimage[(yontv+1+ epimage.length) % epimage.length]
var epnum=epnow
	
document.getElementById('imageone').setAttribute("src", m3);
document.getElementById('imagetwo').setAttribute("src", m4);

document.getElementById('imagethree').setAttribute("src", m6);
document.getElementById('imagefour').setAttribute("src", m7);

document.getElementById('middleimage').setAttribute("src", m5);
document.getElementById('middlelink').setAttribute("href", m53);
document.getElementById('epplot').firstChild.nodeValue=m52;
document.getElementById('eptitle4').firstChild.nodeValue=m54;
document.getElementById('epnumber').firstChild.nodeValue="Episode&#160;"+epnum+".&#160;";
document.getElementById('playlists').setAttribute("href", "<xsl:value-of disable-output-escaping="yes" select="baseFilename"/>.playlist"+epnum+".jsp");
</xsl:if>

<!--###########################/VERTICAL##################################################-->

return
}

function episodespec(y)
{
var glen = epimage.length
var ending = glen - 1
var last = ending - 1

if (y-1<xsl:value-of select="'&lt;'" disable-output-escaping="yes"/>0)
{
yontv=ending
epnow=ending+1
}
else if	(y-1<xsl:value-of select="'&gt;'" disable-output-escaping="yes"/>ending)
{
yontv=0
epnow=epstart
}
else
{
yontv=y-1
epnow=y
}

<!--###########################HORIZONTAL##################################################-->

<xsl:if test="$set-tv='hor'">
var m3 =epimage[(yontv+3+ epimage.length) % epimage.length]
var m4=	epimage[(yontv-1+ epimage.length) % epimage.length]
var m5 =epimage[(yontv + epimage.length) % epimage.length]
var m52	=epplot[(yontv + epimage.length) % epimage.length]
var m53	=epfile[(yontv + epimage.length) % epimage.length]
var m54	=eptitle[(yontv	+ epimage.length) % epimage.length]

var m6 =epimage[(yontv+1+ epimage.length) % epimage.length]
var m7=	epimage[(yontv+2+ epimage.length) % epimage.length]
var epnum=epnow
	
document.getElementById('imageone').setAttribute("src", m3);
document.getElementById('imagetwo').setAttribute("src", m4);

document.getElementById('imagethree').setAttribute("src", m6);
document.getElementById('imagefour').setAttribute("src", m7);

document.getElementById('middleimage').setAttribute("src", m5);
document.getElementById('middlelink').setAttribute("href", m53);
document.getElementById('epplot').firstChild.nodeValue=m52;
document.getElementById('eptitle4').firstChild.nodeValue=m54;
document.getElementById('epnumber').firstChild.nodeValue="Episode "+epnum+".";
document.getElementById('playlists').setAttribute("href", "<xsl:value-of disable-output-escaping="yes" select="baseFilename"/>.playlist"+epnum+".jsp");
return
}

function initpage()
{
var m3 =epimage[(yontv+3+ epimage.length) % epimage.length]
var m4=	epimage[(yontv-1+ epimage.length) % epimage.length]
document.getElementById('imageone').setAttribute("src", m3);
document.getElementById('imagetwo').setAttribute("src", m4);
getParams();
</xsl:if>

<!--###########################/HORIZONTAL##################################################-->

<!--###########################VERTICAL##################################################-->

<xsl:if test="$set-tv='ver'">
var m3 =epimage[(yontv+4+ epimage.length) % epimage.length]
var m4=	epimage[(yontv+3+ epimage.length) % epimage.length]
var m5 =epimage[(yontv + epimage.length) % epimage.length]
var m52	=epplot[(yontv + epimage.length) % epimage.length]
var m53	=epfile[(yontv + epimage.length) % epimage.length]
var m54	=eptitle[(yontv	+ epimage.length) % epimage.length]

var m6 =epimage[(yontv+2+ epimage.length) % epimage.length]
var m7=	epimage[(yontv+1+ epimage.length) % epimage.length]
var epnum=epnow
	
document.getElementById('imageone').setAttribute("src", m3);
document.getElementById('imagetwo').setAttribute("src", m4);

document.getElementById('imagethree').setAttribute("src", m6);
document.getElementById('imagefour').setAttribute("src", m7);

document.getElementById('middleimage').setAttribute("src", m5);
document.getElementById('middlelink').setAttribute("href", m53);
document.getElementById('epplot').firstChild.nodeValue=m52;
document.getElementById('eptitle4').firstChild.nodeValue=m54;
document.getElementById('epnumber').firstChild.nodeValue="Ep "+epnum+".";
document.getElementById('playlists').setAttribute("href", "<xsl:value-of disable-output-escaping="yes" select="baseFilename"/>.playlist"+epnum+".jsp");
return
}

function initpage()
{
var m3 =epimage[(yontv+4+ epimage.length) % epimage.length]
var m4=	epimage[(yontv+3+ epimage.length) % epimage.length]
document.getElementById('imageone').setAttribute("src", m3);
document.getElementById('imagetwo').setAttribute("src", m4);
getParams();
</xsl:if>

<!--###########################/VERTICAL##################################################-->

<xsl:if test="$parental-control-on !='true' and $use-parental-ratings-type2 !='true'">
var tvidup=yon-1
var tviddown=yon+1
var tvidprev="<xsl:value-of select="previous"/>.html"
var tvidnext="<xsl:value-of select="next"/>.html"

document.getElementById('tvidup').setAttribute("href", "javascript:setParams('"+tvidprev+"?"+tvidup.toString()+","+genrecnt+","+alphaid+","+flag+",1,"+escape(dest)+","+yonset.toString()+","+destset+"')");
document.getElementById('tviddown').setAttribute("href", "javascript:setParams('"+tvidnext+"?"+tviddown+","+genrecnt+","+alphaid+","+flag+",1,"+escape(dest)+","+yonset.toString()+","+destset+"')");
</xsl:if>

if (flag==0)
{
 var twoItems =	alphaim[(alphaid+ alphaim.length) % alphaim.length].split(",")
		  

	     document.getElementById('change').firstChild.nodeValue=twoItems[0];
	document.getElementById('change').setAttribute("href","javascript:setParams('"+twoItems[1]+"?"+yon.toString()+","+genrecnt+","+alphaid+","+flag+",1')");
	document.getElementById('backbutton').setAttribute("href","javascript:setParams('"+escape(dest)+"?"+yon+","+genrecnt+","+alphaid+","+flag+",1,"+escape(dest)+","+yonset.toString()+","+destset+"')");
}
else
{
var genreItems = genreim[(genrecnt + genreim.length) % genreim.length].split(",")
	   
		   document.getElementById('change').firstChild.nodeValue=genreItems[0];
				   document.getElementById('change').setAttribute("href","javascript:setParams('"+genreItems[1]+"?"+yon.toString()+","+genrecnt+","+alphaid+","+flag+",1')");
	document.getElementById('backbutton').setAttribute("href","javascript:setParams('"+escape(dest)+"?"+yon+","+genrecnt+","+alphaid+","+flag+",1,"+escape(dest)+","+yonset.toString()+","+destset+"')");
}
}
</script>
</xsl:template>

<!--######################################################## TV HTML PART #####################################################-->

<xsl:template name="meow-tv-html">

<!--######################################################## TV HORIZONTAL LAYOUT  #####################################################-->

<xsl:if test="$set-tv='hor'">
<a href="#movies4" onfocusload="" onfocus="return episodechange(5)" onclick="return moviechange(5)" name="downn"/>
<a href="#movies4" onfocusload="" onfocus="return episodechange(-5)" onclick="return moviechange(-5)" name="upn"/>
<a href="#movies4" onfocusload="" onfocus="return episodechange(1)" onclick="return moviechange(1)" name="rightn"/>
<a href="#movies4" onfocusload="" onfocus="return episodechange(-1)" onclick="return moviechange(-1)" name="leftn"/>
<a href="#" onclick="return toggleplot(0)" id="navchange" tvid="clear"/>
<xsl:for-each select="files/file">
<a onfocusload="">
<xsl:attribute name="onfocus">return episodespec(<xsl:value-of select="position()"/>)</xsl:attribute>
<xsl:attribute name="onclick">return episodespec(<xsl:value-of select="position()"/>)</xsl:attribute>
<xsl:attribute name="href">#<xsl:value-of select="position()"/></xsl:attribute>
<xsl:attribute name="tvid"><xsl:value-of select="position()"/></xsl:attribute>
</a>
</xsl:for-each>
</xsl:if>
<!--######################################################## / TV HORIZONTAL LAYOUT  #####################################################-->

<!--######################################################## TV VERTICAL LAYOUT  #####################################################-->
<xsl:if test="$set-tv='ver'">
<a href="#movies4" onfocusload="" onfocus="return episodechange(1)" onclick="return moviechange(5)" name="downn"/>
<a href="#movies4" onfocusload="" onfocus="return episodechange(-1)" onclick="return moviechange(-5)" name="upn"/>
<a href="#movies4" onfocusload="" onfocus="return episodechange(5)" onclick="return moviechange(1)" name="rightn"/>
<a href="#movies4" onfocusload="" onfocus="return episodechange(-5)" onclick="return moviechange(-1)" name="leftn"/>
<a href="#" onclick="return toggleplot(0)" id="navchange" tvid="clear"/>
<xsl:for-each select="files/file">
<a onfocusload="">
<xsl:attribute name="onfocus">return episodespec(<xsl:value-of select="position()"/>)</xsl:attribute>
<xsl:attribute name="onclick">return episodespec(<xsl:value-of select="position()"/>)</xsl:attribute>
<xsl:attribute name="href">#<xsl:value-of select="position()"/></xsl:attribute>
<xsl:attribute name="tvid"><xsl:value-of select="position()"/></xsl:attribute>
</a>
</xsl:for-each>
</xsl:if>
<!--######################################################## / TV VERTICAL LAYOUT  #####################################################-->


<!--######################################################## TV HORIZONTAL LAYOUT  #####################################################-->

<xsl:if test="$set-tv='hor'">
<table height="656" width="1100" border="0" cellpadding="0" cellspacing="0" valign="center">
	<tr>
		<td height="53">
					<a>
					   <xsl:attribute name="href"><xsl:value-of disable-output-escaping="yes" select="baseFilename"/>.playlist1.jsp</xsl:attribute>
					   <xsl:attribute name="id">playlists</xsl:attribute>
					   <xsl:attribute name="vod">playlist</xsl:attribute>
					   <xsl:attribute name="tvid">play</xsl:attribute>
					 </a>
		</td>
	</tr>
	<tr>
		<td width="100%" id="popup-hor" align="center" valign="top" height="250">
			<table cellpadding="10"	 border="0" width="865"	height="225" background="pictures/meow/detailmeowbg.png">
				<tr>
					<td class="episodePlotMhor" valign="center" id="epplot">
					<xsl:value-of select="concat(substring(translate(files/file[1]/filePlot, '&quot;', &quot;'&quot;), 1, 500), '...')"/>
					</td>
					<td width="5" rowspan="1">
						<xsl:choose>
						<xsl:when test="$display-plot='true'">
						<img  height="225" src="pictures/vspacer150.png"/>
						</xsl:when>
						<xsl:otherwise>
						<img height="250" src="pictures/vspacer249.png"/>
						</xsl:otherwise>
						</xsl:choose>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td>
			<img height="30" src="pictures/vspacer249.png"/>
		</td>
	</tr>

</table>
<table border="0">
	<tr>
		<td>
			<table border="0" width="100%">
	<tr>
		<td rowspan="2" valign="bottom">
			<table border="0" cellpadding="0">
				<tr>
					<td id="image2" align="center" valign="center">
					<img width="181" id="imagetwo">
						  <xsl:attribute name="src">
						    <xsl:value-of disable-output-escaping="yes" select="files/file[1]/fileImageFile"/>
						  </xsl:attribute>
						  <xsl:attribute name="height">102</xsl:attribute>
						  </img>
					</td>
				</tr>
			</table>
		</td>
		<td rowspan="2" valign="bottom">
			<table border="0" cellpadding="0">
				<tr>
					<td id="image3"	align="center" valign="center">
										 
					 <a onkeyleftset="leftn" onkeyrightset="rightn"	onkeyupset="upn" onkeydownset="downn" id="middlelink" name="movies4">
					   <xsl:attribute name="href"><xsl:value-of select="files/file[1]/fileURL"/></xsl:attribute>
						<xsl:choose>
											<xsl:when test="//movie/container='DVD Video' or //movie/container='dvd video'">
												<xsl:attribute name="zcd">2</xsl:attribute>
											</xsl:when>
											<xsl:when test="//movie/container='ISO' or //movie/container='iso'">
												<xsl:attribute name="zcd">2</xsl:attribute>
											</xsl:when>
											<xsl:when test="//movie/container='IMG' or //movie/container='img'">	
												<xsl:attribute name="zcd">2</xsl:attribute>
											</xsl:when>
											<xsl:when test="substring(files/file[1]/fileURL,string-length(files/file[1]/fileURL)-7,8) = 'VIDEO_TS'">
												<xsl:attribute name="zcd">2</xsl:attribute> 
											</xsl:when>
											<xsl:when test="//movie/container='vob' or //movie/container='VOB' and $nomenus='true'">
												<xsl:attribute name="vod"/> 
											</xsl:when>
											<xsl:when test="//movie/container='vob' or //movie/container='VOB'">
												<xsl:attribute name="zcd">2</xsl:attribute> 
											</xsl:when>
											<xsl:when test="//movie/container= 'MDF' or //movie/container='mdf'">
												<xsl:attribute name="zcd">2</xsl:attribute>
											</xsl:when>
											<xsl:when test="//movie/container= 'NRG' or //movie/container='nrg'">
												<xsl:attribute name="zcd">2</xsl:attribute>
											</xsl:when>
											<xsl:when test="//movie/container= 'BIN' or //movie/container='bin'">
												<xsl:attribute name="zcd">2</xsl:attribute>
											</xsl:when>
											<xsl:otherwise>
												<xsl:attribute name="vod"/>
											</xsl:otherwise>
											</xsl:choose>					   
					   <img	width="326" id="middleimage">
						  <xsl:attribute name="src">
						    <xsl:value-of disable-output-escaping="yes" select="files/file[1]/fileImageFile"/>
						  </xsl:attribute>
						  <xsl:attribute name="height">184</xsl:attribute>
						  </img>
					   </a>
					</td>
				</tr>
			</table>
		</td>
		<td height="78" colspan="3" valign="bottom">
			<table cellpadding="3" border="0">
				<tr>
					<td id="eptitle" valign="center" align="left">
						<table width="560" background="pictures/meow/detailmeowbg.png" cellspacing="0" cellpadding="5" border="0">
							<tr>
								<td class="episodenumberMhor" align="left" id="epnumber">
									Episode&#160;<xsl:value-of	select="files/file[1]/@firstPart"/>.
									<span  class="episodenumberMhor" align="left" id="eptitle4">
										&#160;<xsl:value-of select="files/file[1]/@title" />
						
									</span>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td valign="bottom">
			<table border="0" cellpadding="0">
				<tr>
					<td id="image4" align="center" valign="bottom">
						<img width="181" id="imagethree">
						  <xsl:attribute name="src">
						    <xsl:value-of disable-output-escaping="yes" select="files/file[2]/fileImageFile"/>
						  </xsl:attribute>
						  <xsl:attribute name="height">102</xsl:attribute>
						  </img>
					</td>
				</tr>
			</table>
		</td>
		<td valign="bottom">
			<table border="0" cellpadding="0">
				<tr>
					<td id="image5" align="center" valign="center">
						<img width="181" id="imagefour">
						  <xsl:attribute name="src">
						    <xsl:value-of disable-output-escaping="yes" select="files/file[3]/fileImageFile"/>
						  </xsl:attribute>
						  <xsl:attribute name="height">102</xsl:attribute>
						  </img>
					</td>
				</tr>
			</table>
		</td>
		<td valign="bottom">
			<table border="0" cellpadding="0">
				<tr>
					<td id="image1"	background="tv-frame5.png" align="center" valign="center">
						<img width="181" id="imageone">
						  <xsl:attribute name="src">
						    <xsl:value-of disable-output-escaping="yes" select="files/file[1]/fileImageFile"/>
						  </xsl:attribute>
						  <xsl:attribute name="height">102</xsl:attribute>
						  </img>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</td>
</tr>
</table>
<table align="center"  width="1005" border="0">
<xsl:choose>
	<xsl:when test="$miniplot = 'true'">
				<tr>
					<td class="miniplothor" valign="center" id="epplot">
					<xsl:value-of select="concat(substring(translate(files/file[1]/filePlot, '&quot;', &quot;'&quot;), 1, 150), '...')"/>
					</td>
				</tr>
	</xsl:when>
	<xsl:otherwise>
	<tr>
		<td >
			<img height="5" src="pictures/vspacer25.png"/>
		</td>
	</tr>
	</xsl:otherwise>
	</xsl:choose>
<tr>
<td>
<table background="pictures/meow/detailmeowbg.png" align="center" width="1005" border="0">
	<tr>
		<td>
			<table width="600" cellspacing="0" cellpadding="5" border="0">
				<tr>
					<td colspan="5" align="center" width="100%" class="tvinfoMhor">
						<xsl:value-of disable-output-escaping="yes" select="title"/>&#160;|&#160;Season&#160;<xsl:value-of select="season"/>&#160;|&#160;<xsl:value-of select="year"/>
							<xsl:if test="count(files/file)=1">&#160;|&#160;<xsl:value-of select="count(files/file)" /> Ep</xsl:if>
							<xsl:if test="count(files/file)!=1">&#160;|&#160;<xsl:value-of select="count(files/file)" /> Eps</xsl:if>
					   &#160;|&#160;<xsl:value-of select="runtime"/>&#160;min
							<xsl:if	test="rating !=	-1">
	            		 &#160;|&#160;IMDB&#160;<xsl:value-of select="(rating div 10.0)" />
							</xsl:if>
					</td>
				</tr>
				<tr align="center" valign="top">	
					<td width="150" align="center" valign="center" class="tvinfoMhor">
						<xsl:call-template name ="network"></xsl:call-template>
					</td>
					<td width="150" align="center" valign="center" class="tvinfoMhor">
						<xsl:call-template name="certification"></xsl:call-template>
					</td>
					<td width="150" align="center" valign="center" class="tvinfoMhor">
						<xsl:call-template name="TVvideoOutput"></xsl:call-template>
					</td>
					<td width="150" align="center" valign="center" class="tvinfoMhor">
						<xsl:call-template name ="TVaudioCodec"></xsl:call-template>
					</td>
				</tr>
			</table>
		</td>
		<td align="center">
			<table width="400" cellspacing="0" cellpadding="0" border="0" >
				<tr>
					<td align="center" rowspan="2">
						<img>
							 <xsl:attribute name="src">
							 <xsl:value-of disable-output-escaping="yes" select="bannerFile"/>
							 </xsl:attribute>
							 <xsl:attribute name="height">70</xsl:attribute>
						</img>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</td>
</tr>
</table>
<img src="pictures/meow/meowoverlayTV.png" id="TvInfoOverlay"/>
<img src="pictures/meow/episodtitleoverlay.png" id="episodetitleoverlay"/>
<img src="pictures/meow/episodeplotshadow3.png" id="epplotoverlay"/>
<img src="pictures/meow/Episodeoverlay3.png"	id="epoverlay"/>
<img src="pictures/navbar2.png"	id="navimage"/>
	<div id="navlinks" align="center" valign="center" height="50" class="movietitle">
		<a href="Other_All_1.html" class="movietitle" name="middle" onkeyupset="leters"	onkeydownset="leters" onkeyleftset="left" onkeyrightset="right"	id="change">All</a>
	</div>
</xsl:if>


<!--######################################################## TV VERTICAL LAYOUT  #####################################################-->

<xsl:if test="$set-tv='ver'">
<table class="main" background="pictures/meow/tv-ver-bg.png" width="1100" height="656"  border="0" cellspacing="0">
	<tr>
		<td width="700">
			<table cellpadding="0" cellspacing="10" border="0">
				<tr>
					<td height="10" colspan="2" width="700">
						<a>
					   <xsl:attribute name="href"><xsl:value-of disable-output-escaping="yes" select="baseFilename"/>.playlist1.jsp</xsl:attribute>
					   <xsl:attribute name="id">playlists</xsl:attribute>
					   <xsl:attribute name="vod">playlist</xsl:attribute>
					   <xsl:attribute name="tvid">play</xsl:attribute>
						</a>
						<img height="10" src="pictures/meow/blank20.png">
						</img>
					</td>
				</tr>
				<tr>
					<xsl:choose>
					<xsl:when test= "$show-banner-ver='true'">
					<td width="680" height="84" align="center">
						<img>
							 <xsl:attribute name="src">
							 <xsl:value-of disable-output-escaping="yes" select="bannerFile"/>
							 </xsl:attribute>
							 <xsl:attribute name="width">450</xsl:attribute>
						</img>
					</td>
					<td width="20" rowspan="6" align="center">
						<img width="20" src="pictures/meow/blank20.png">
						</img>
					</td>
					</xsl:when>
					<xsl:otherwise>
					<td width="250" rowspan="6" align="center">
						<img>
							 <xsl:attribute name="src">
							 <xsl:value-of disable-output-escaping="yes" select="posterFile"/>
							 </xsl:attribute>
							 <xsl:attribute name="width">200</xsl:attribute>
						</img>
					</td>
					<td width="450" height="84" align="left">
						<img height="84" width="400" src="pictures/meow/blank20.png">
						</img>
					</td>
					</xsl:otherwise>
					</xsl:choose>
				</tr>
				<tr>
					<td width="450" >
						<xsl:if	test="rating !=	-1">
							<table align="center" border="0">
								<td colspan="0" nowrap="true" class="starsMtvver" valign="bottom" align="center">
										<xsl:choose>
											<xsl:when test="contains(rating,' ')"> 
												<xsl:call-template name="starIMDB"> 
													<xsl:with-param	name="numIMDB" select="(rating div 10.0)" /> 
												</xsl:call-template> 
											</xsl:when> 
										<xsl:otherwise>	
											<xsl:call-template name="starIMDB"> 
												<xsl:with-param	name="numIMDB" select="(rating div 10.0)" /> 
											</xsl:call-template> 
										</xsl:otherwise>
										</xsl:choose>
								</td>
								<td class="starsMtvver" align="left" valign="center">
									<xsl:value-of select="(rating div 10.0)" />
								</td>
							</table>
						</xsl:if>
					</td>
				</tr>
				<tr>
					<td width="450" height="13">
						<table align="center" cellspacing="0" border="0">
							<tr  align="center">
								<td>
								<img height="13" src="pictures/meow/blank20.png">
								</img>
								</td>
							</tr>
						</table>
					</td>

				</tr>
				<tr>
					<td width="450" align="center" valign="center">
						<table cellspacing="5">
							<tr align="center" valign="top">	
								<td width="112" align="center" valign="center" class="tvinfoMver">
									<xsl:call-template name ="network"></xsl:call-template>
								</td>
								<td width="112" align="center" valign="center" class="tvinfoMver">
									<xsl:call-template name="certification"></xsl:call-template>
								</td>
								<td width="112" align="center" valign="center" class="tvinfoMver">
									<xsl:call-template name="TVvideoOutput"></xsl:call-template>
								</td>
								<td width="112" align="center" valign="center" class="tvinfoMver">
									<xsl:call-template name ="TVaudioCodec"></xsl:call-template>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td width="450" height="17">
						<table align="center" cellspacing="0" border="0">
							<tr  align="center">
								<td>
								<img height="17" src="pictures/meow/blank20.png">
								</img>
								</td>
							</tr>
						</table>
					</td>

				</tr>
				<tr>
					<td height="70" width="450" align="center" class="tvinfoMver">
								Season&#160;<xsl:value-of select="season"/>&#160;&#160;&#160;&#160;<xsl:value-of select="year"/>
									<xsl:if test="count(files/file)=1">&#160;&#160;&#160;&#160;<xsl:value-of select="count(files/file)" /> Ep</xsl:if>
									<xsl:if test="count(files/file)!=1">&#160;&#160;&#160;&#160;<xsl:value-of select="count(files/file)" /> Eps</xsl:if>
								&#160;~&#160;<xsl:value-of select="runtime"/>min
					</td>
				</tr>
				<tr>
					<td height="46" colspan="2" align="right" valign="bottom">
						<table cellpadding="3" border="0">
							<tr>
								<td height="35" id="eptitle" valign="bottom" align="right">
									<table cellspacing="0" cellpadding="0" border="0">
										<tr>
											<td  class="episodetitleMver" valign="bottom" align="right" id="eptitle4">
											<xsl:value-of disable-output-escaping="yes" select="files/file[1]/@title"/>
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td background="pictures/meow/tv-ver-plotbg2.png" id="popup-ver" colspan="2" width="700" align="center" valign="center" height="226">
						<table cellpadding="5"	 border="0" width="680"	height="220">
							<tr>
								<td class="episodePlotMver" align="left" valign="center" id="epplot">
									<xsl:value-of select="concat(substring(translate(files/file[1]/filePlot, '&quot;', &quot;'&quot;), 1, 500), '...')"/>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
		<td valign="center" width="400">
			<table boder="" cellpadding="0">
				<tr>
					<td colspan="2" align="right" valign="center">
						<table border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td id="image1" align="center" valign="center">
									<img width="123" id="imageone">
									  <xsl:attribute name="src">
									  <xsl:value-of disable-output-escaping="yes" select="files/file[5]/fileImageFile"/>
									  </xsl:attribute>
									  <xsl:attribute name="height">71</xsl:attribute>
									</img>
								</td>
								<td width="5" colspan="" align="right" valign="center">
												<img width="5" height="5" src="pictures/meow/blank20.png">
												</img>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td colspan="2" align="right" valign="center">
						<table border="0" cellpadding="0">
							<tr>
								<td id="image2"	 align="center" valign="center">
									<img width="148" id="imagetwo">
									<xsl:attribute name="src">
									<xsl:value-of disable-output-escaping="yes" select="files/file[4]/fileImageFile"/>
									</xsl:attribute>
									<xsl:attribute name="height">85</xsl:attribute>
									</img>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td colspan="2" align="right" valign="center">
						<table border="0" cellpadding="0">
							<tr>
								<td id="image4" align="center" valign="bottom">
									<img width="173" id="imagethree">
									 <xsl:attribute name="src">
									<xsl:value-of disable-output-escaping="yes" select="files/file[3]/fileImageFile"/>
									</xsl:attribute>
									<xsl:attribute name="height">99</xsl:attribute> 
									</img>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td height="35" id="eptitle" valign="bottom" align="left">
									<table cellspacing="0" cellpadding="0" border="0">
										<tr>
											<td class="episodenumberMver" valign="bottom" align="right" id="epnumber">
										Episode&#160;<xsl:value-of select="files/file[1]/@firstPart"/>.
											</td>
										</tr>
										<tr>
											<td height="8">
												<img height="8" src="pictures/meow/blank20.png">
												</img>
											</td>
										</tr>
									</table>
								</td>
					<td align="right" valign="center">
						<table border="0" cellpadding="0">
							<tr>
								<td id="image5"	 align="center" valign="bottom">
									<img width="213" id="imagefour">
									 <xsl:attribute name="src">
									<xsl:value-of disable-output-escaping="yes" select="files/file[2]/fileImageFile"/>
									</xsl:attribute>
									<xsl:attribute name="height">121</xsl:attribute> 
									</img>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td colspan="2" align="right" valign="center">
						<table border="0" cellpadding="0">
							<tr>
								<td id="image3"	align="center" valign="center">
									<a onkeyleftset="leftn" onkeyrightset="rightn"	onkeyupset="upn" onkeydownset="downn" id="middlelink" name="movies4">
										<xsl:attribute name="href"><xsl:value-of select="files/file[1]/fileURL"/></xsl:attribute>
											<xsl:choose>
											<xsl:when test="//movie/container='DVD Video' or //movie/container='dvd video'">
												<xsl:attribute name="zcd">2</xsl:attribute>
											</xsl:when>
											<xsl:when test="//movie/container='ISO' or //movie/container='iso'">
												<xsl:attribute name="zcd">2</xsl:attribute>
											</xsl:when>
											<xsl:when test="//movie/container='IMG' or //movie/container='img'">	
												<xsl:attribute name="zcd">2</xsl:attribute>
											</xsl:when>
											<xsl:when test="substring(files/file[1]/fileURL,string-length(files/file[1]/fileURL)-7,8) = 'VIDEO_TS'">
												<xsl:attribute name="zcd">2</xsl:attribute> 
											</xsl:when>
											<xsl:when test="//movie/container='vob' or //movie/container='VOB' and $nomenus='true'">
												<xsl:attribute name="vod"/> 
											</xsl:when>
											<xsl:when test="//movie/container='vob' or //movie/container='VOB'">
												<xsl:attribute name="zcd">2</xsl:attribute> 
											</xsl:when>
											<xsl:when test="//movie/container= 'MDF' or //movie/container='mdf'">
												<xsl:attribute name="zcd">2</xsl:attribute>
											</xsl:when>
											<xsl:when test="//movie/container= 'NRG' or //movie/container='nrg'">
												<xsl:attribute name="zcd">2</xsl:attribute>
											</xsl:when>
											<xsl:when test="//movie/container= 'BIN' or //movie/container='bin'">
												<xsl:attribute name="zcd">2</xsl:attribute>
											</xsl:when>
											<xsl:otherwise>
												<xsl:attribute name="vod"/>
											</xsl:otherwise>
											</xsl:choose>					   
										<img	width="398" id="middleimage">
										<xsl:attribute name="src">
										<xsl:value-of disable-output-escaping="yes" select="files/file[1]/fileImageFile"/>
										</xsl:attribute>
										<xsl:attribute name="height">226</xsl:attribute>
										<xsl:attribute name="onfocussrc">pictures/meow/tv-ver-focus.png</xsl:attribute>
										
										</img>
									</a>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>

<xsl:if test="$show-banner-ver='false'">
	<xsl:call-template name="boxme-tv"></xsl:call-template>
</xsl:if>
<xsl:if test="$show-banner-ver='true'">
	<img width="450" src="pictures/meow/banner-overlay.png" id="banneroverlay"/>
</xsl:if>
<img src="pictures/meow/meowoverlayTV.png" id="TvInfoOverlay"/>
<img src="pictures/meow/tv-ver-plot-overlay.png" id="epplotoverlay"/>
<img src="pictures/meow/tv-ver-overlay.png"	id="epoverlay"/>
<img src="pictures/navbar2.png"	id="navimage"/>
	<div id="navlinks" align="center" valign="center" height="50" class="movietitle">
		<a href="Other_All_1.html" class="movietitle" name="middle" onkeyupset="leters"	onkeydownset="leters" onkeyleftset="left" onkeyrightset="right"	id="change">All</a>
	</div>
</xsl:if>

  </xsl:template>
 </xsl:stylesheet>